]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellDBus: Add new BrightnessChanged signal to brightness interface
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 24 Nov 2025 16:16:57 +0000 (17:16 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 12 Jan 2026 13:44:26 +0000 (13:44 +0000)
This does actually track user-triggered changes, so other pieces
(i.e. gsd-power) can react to this. This will help in reintroducing
brightness re-normalization when brightness is driven by ALS sensors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3979>

data/dbus-interfaces/org.gnome.Shell.Brightness.xml
js/ui/shellDBus.js

index a0e63972863836290fdc94414c34274ebe46fc9c..9bfed250522e714ea4b33ed1942c6bf49e1808d0 100644 (file)
     -->
     <property name="HasBrightnessControl" type="b" access="read"/>
 
+    <!--
+        BrightnessChanged:
+
+        Brightness was changed by the user.
+    -->
+    <signal name="BrightnessChanged" />
+
   </interface>
 </node>
index 17f43e46ea6b1039ad89ec6e1d216143b064aaca..1e5a6a3226b4051b2a82f4e8b66ae5fb20a43c85 100644 (file)
@@ -602,7 +602,10 @@ export class BrightnessDBus {
         Gio.DBus.session.own_name('org.gnome.Shell.Brightness',
             Gio.BusNameOwnerFlags.NONE, null, null);
 
-        this._manager.connectObject('changed', this._sync.bind(this), this);
+        this._manager.connectObject(
+            'changed', () => this._sync(),
+            'user-update', () => this._userChange(),
+            this);
         this._sync();
     }
 
@@ -616,6 +619,10 @@ export class BrightnessDBus {
             new GLib.Variant('b', this._hasBrightnessControl));
     }
 
+    _userChange() {
+        this._dbusImpl.emit_signal('BrightnessChanged', null);
+    }
+
     SetDimming(enable) {
         this._manager.dimming = enable;
     }